<div class="main_box"> 
	<div id="mainContent_2"> 
		<div id="list-items">
			<div class="list_title">
	您当前的E币余额为：<span style="font-weight:bold;color:red"><?php echo $userCoins;?></span> 
	<br>
	<p align="right">
<?php
	if($type==0)
	{
?>
		<a href="<?php echo edp_href_link(PAGENAME_COUPON_SUMMARY);?>">我要兑换优惠券>></a>
<?php
	} 
	else
	{
?>
		<a href="<?php echo edp_href_link(PAGENAME_GIFT_SUMMARY);?>">我要兑换礼品>></a>
<?php
	}
?>
	</p>
	</div>					
	<div class="switch_menu">
		<ul>
<?php
	if($type==0)
	{
?>
		<li class="tab_current" id="t1"><span class="spancolor1">优惠卷兑换记录</span></li>
		<a class="ta" href="<?php echo edp_href_link(PAGENAME_CONSUMPTION_HISTORY, 'type=1');?>"><li class="tab_show" id="t2"><span class="spancolor">礼品兑换记录</span></li></a>						                                                
<?php
	} 
	else
	{
?>
		<a class="ta" href="<?php echo edp_href_link(PAGENAME_CONSUMPTION_HISTORY, 'type=0');?>"><li class="tab_show" id="t1"><span class="spancolor">优惠券兑换记录</span></li></a>	
		<li class="tab_current" id="t2"><span class="spancolor2">礼品兑换记录</span></li>
<?php
	}
?>
		</ul>
	</div>
	<div class="bar"></div>
	<div class="box" id="alb1">
	
	<?php
	if($histories)
	{
?>		
			<dl>
			<dt>
				<div style="width:200px">
				<?php 
				if($type==0) 
					echo '优惠券名称'; 
				else
					echo '礼品名称'; 
				?>
				</div>
				<div>价格(E币)</div>
				<div>兑换日期</div>
				<div>状态</div>	
				
				<?php
				if($type==0)
				{
					echo '<div>优惠券密码</div>';
				} 
				else
				{
					echo '<div>备注信息</div>';
				}
				?>	
					
			</dt>
			<?php
					foreach($histories as $history)
					{
			?>
						<dd>
						<div style="width:200px">
			<?php
							if($history['status']==1)
							{
								if($type==0)
								{
			?>
									<a href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$history['coupon_id']);?>">
			<?php	
								}
								else
								{
			?>
									<a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$history['gift_id']);?>">
			<?php
								}
							}
							
							echo $history['name'];
								
							if($history['status']==1)
							{
								echo '</a>';
							}
							
			?>
							</div>		
							<div><?php echo $history['price'];?></div>
							<div><?php echo EdpSubStr($history['exchange_date'], 0, 10);?></div>
							<div>
			<?php
							if($history['process_status']==1) 
								echo '<div><span style="color:green">完成</span></div>';
							else
								echo '<span style="color:red">待处理</span>';
			?>
							</div>
							
			<?php 
							echo '<div>'.$history['note1'].'</div>';
			?>			
							
					
						</dd>
			<?php
					} 
			?>
			<dl>
<?php	
	}
?>			
			
		

	</div>
	<div style="clear:both"></div>
	<div class="btm"></div>
	<? echo $pageObj->getBar();  ?>
	</div>
</div>

	<div id="sidebar_right">
 		<div class="column bdbottom2" >
     	 <div class="btna solidbottom"><h4>热门优惠券</h4></div>   
<?php 
     if($hotCoupons) 
     {	
      		$i = 1;
      		foreach( $hotCoupons as $coupon ) 
      		{
?>
      	<p><a <?php if( $i < 3 ) echo 'class="red"';?>  href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='. $coupon['coupon_id']);?>"><?php echo $coupon['coupon_name'];?></a></p>
<?php 	
      			$i++;
      		}
      	}
?>
    </div>
    
    <div class="column bdbottom2" >
		<div class="btna solidbottom"><h4>热门礼品</h4></div>
<?php 
	if($hotGifts)
	{
		$i = 1;
		foreach($hotGifts as $key=>$gift)
		{
?>
      		<p><a <?php if( $i < 3 ) echo 'class="red"';?>  href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='. $gift['gift_id']);?>"><?php echo $gift['gift_name'];?></a></p>
<?php 	
      		$i++;
		}
	}
?>
     </div>
  </div>

	